<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Clique Projection: Doll.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Clique Projection
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Doll.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="Doll_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#ifndef DOLL_H_</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DOLL_H_</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="Grafo_8h.html">Grafo.h</a>&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="VertexSet_8h.html">VertexSet.h</a>&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div>
<div class="line"><a name="l00015"></a><span class="lineno"><a class="code" href="classDoll.html">   15</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDoll.html">Doll</a></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;{</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="code" href="classDoll.html#a25877667b187e89298a2809f646bb174">   18</a></span>&#160;        <span class="keyword">const</span> <a class="code" href="classGrafo.html">Grafo</a>&amp;    <a class="code" href="classDoll.html#a25877667b187e89298a2809f646bb174">_grafo</a>;</div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">   19</a></span>&#160;        <span class="keywordtype">int</span>                             <a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a>;</div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">   20</a></span>&#160;        <span class="keywordtype">int</span>                             <a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">nodeidx</a>;</div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">   21</a></span>&#160;        <a class="code" href="classVertexSet.html">VertexSet</a>*              <a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">R</a>;</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="code" href="classDoll.html#aa2359be61205ad1a4676c2f56dde4ca4">   22</a></span>&#160;        <a class="code" href="classVertexSet.html">VertexSet</a>*              <a class="code" href="classDoll.html#aa2359be61205ad1a4676c2f56dde4ca4">W</a>;</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">   23</a></span>&#160;        <a class="code" href="classSingleNodeSet.html">SingleNodeSet</a>*  <a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a>;</div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="code" href="classDoll.html#a1ed3060b99d048557e79b0ab6d6f0b51">   24</a></span>&#160;        <a class="code" href="classSingleNodeSet.html">SingleNodeSet</a>*  <a class="code" href="classDoll.html#a1ed3060b99d048557e79b0ab6d6f0b51">Wnode</a>;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        <a class="code" href="classDoll.html">Doll</a>(<span class="keyword">const</span> <a class="code" href="classGrafo.html">Grafo</a>&amp; g);</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        ~<a class="code" href="classDoll.html">Doll</a>();</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        <span class="keywordtype">int</span> nextUpTo(<span class="keywordtype">int</span> lastnode);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        <span class="keywordtype">void</span> startUp(<span class="keywordtype">int</span> v, <a class="code" href="classVertexSet.html">VertexSet</a>&amp; subset);</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;};</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="code" href="classDoll.html#a7570974a25ea1f7ef5b4735b91619a63">   32</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classDoll.html#a7570974a25ea1f7ef5b4735b91619a63">Doll::Doll</a>(<span class="keyword">const</span> <a class="code" href="classGrafo.html">Grafo</a>&amp; g) : _grafo(g), vidx(0), nodeidx(0), R(NULL)</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;{</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <a class="code" href="classDoll.html#aa2359be61205ad1a4676c2f56dde4ca4">W</a> = <span class="keyword">new</span> <a class="code" href="classVertexSet.html">VertexSet</a>(<a class="code" href="classDoll.html#a25877667b187e89298a2809f646bb174">_grafo</a>.<a class="code" href="classGrafo.html#afd3b88c85b7c53d75c067f509b7ca62f" title="Devuelve la cantidad de vértices.">getN</a>());</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        <a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a> = <span class="keyword">new</span> <a class="code" href="classSingleNodeSet.html">SingleNodeSet</a>();</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        <a class="code" href="classDoll.html#a1ed3060b99d048557e79b0ab6d6f0b51">Wnode</a> = <span class="keyword">new</span> <a class="code" href="classSingleNodeSet.html">SingleNodeSet</a>();</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;}</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="classDoll.html#a859a26dbf92a0867d77faca3d44c24f4">   39</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classDoll.html#a859a26dbf92a0867d77faca3d44c24f4">Doll::~Doll</a>()</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <span class="keyword">delete</span> <a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">R</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <span class="keyword">delete</span> <a class="code" href="classDoll.html#aa2359be61205ad1a4676c2f56dde4ca4">W</a>;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="keyword">delete</span> <a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a>;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="keyword">delete</span> <a class="code" href="classDoll.html#a1ed3060b99d048557e79b0ab6d6f0b51">Wnode</a>;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;}</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="classDoll.html#ae3e9a5b70e8a665bdd71a746a99cbde4">   47</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classDoll.html#ae3e9a5b70e8a665bdd71a746a99cbde4">Doll::nextUpTo</a>(<span class="keywordtype">int</span> lastnode)</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;{</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="keywordtype">int</span> v;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a> = <a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a>-&gt;<a class="code" href="classSingleNodeSet.html#a1931bd787152274d7844c2bb7407f405">least</a>();</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <span class="keywordflow">while</span> (<a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a> &lt; 0 &amp;&amp; <a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">nodeidx</a> &lt; lastnode) {</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;                <a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">R</a>-&gt;<a class="code" href="classVertexSet.html#aa3b9b46028cf597268ac0bd609923e8f">nodeView</a>(++<a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">nodeidx</a>, *<a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a>);</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;                <a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a> = <a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a>-&gt;<a class="code" href="classSingleNodeSet.html#a1931bd787152274d7844c2bb7407f405">least</a>();</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        }</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a> &lt; 0)</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                <span class="keywordflow">return</span> -1;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        v = <a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a> + <a class="code" href="VertexSet_8h.html#a4642ff745cdc525c7566b436f452e33f" title="Smallest element in the entry i of the bitmap.">NELEM</a>(<a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">nodeidx</a>);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a>-&gt;<a class="code" href="classSingleNodeSet.html#ae7accc3d61c08355684a55f47d7b3a96">remove</a>(<a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a>);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <a class="code" href="classDoll.html#aa2359be61205ad1a4676c2f56dde4ca4">W</a>-&gt;<a class="code" href="classVertexSet.html#aa3b9b46028cf597268ac0bd609923e8f">nodeView</a>(<a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">nodeidx</a>, *<a class="code" href="classDoll.html#a1ed3060b99d048557e79b0ab6d6f0b51">Wnode</a>);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <a class="code" href="classDoll.html#a1ed3060b99d048557e79b0ab6d6f0b51">Wnode</a>-&gt;<a class="code" href="classSingleNodeSet.html#a6af26cd9a2acdbe5ea70f0e9ad106bca">add</a>(<a class="code" href="classDoll.html#a851a86be6f8518c5c123765daa0cb26b">vidx</a>);</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        <span class="keywordflow">return</span> v;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;}</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="classDoll.html#a5c87453ed537b456b2e368d1a5c13afd">   68</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classDoll.html#a5c87453ed537b456b2e368d1a5c13afd">Doll::startUp</a>(<span class="keywordtype">int</span> v, <a class="code" href="classVertexSet.html">VertexSet</a>&amp; subset)</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;{</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">R</a>-&gt;<a class="code" href="classVertexSet.html#a89509715aacc2aca84233e4391b05ff6">copyAll</a>(subset);</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="comment">// note that v remains in _RR only if clqOrStab=false</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">R</a>-&gt;<a class="code" href="classVertexSet.html#a1fda19b2def1d7e38aab5747b9d30d39">retainAll</a>(<a class="code" href="classDoll.html#a25877667b187e89298a2809f646bb174">_grafo</a>.<a class="code" href="classGrafo.html#a6655b3cc3062341428b5138a20e2423d">vecinos</a>(v));</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">R</a>-&gt;<a class="code" href="classVertexSet.html#a6d9fc4112b029f2cb40fc59a80082ca9">remove</a>(v);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">nodeidx</a> = 0;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <a class="code" href="classDoll.html#a6d409267a234f2a3dcb0d9b0afeab1d1">R</a>-&gt;<a class="code" href="classVertexSet.html#aa3b9b46028cf597268ac0bd609923e8f">nodeView</a>(<a class="code" href="classDoll.html#a5717b79e492307d8b0354a5a9577393e">nodeidx</a>, *<a class="code" href="classDoll.html#ad61a7cc57ced627e1b7899b553816f36">Rnode</a>);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <a class="code" href="classDoll.html#aa2359be61205ad1a4676c2f56dde4ca4">W</a>-&gt;<a class="code" href="classVertexSet.html#a1ad5baec3f40e902656e4fb5c3cf9b6d">removeAll</a>();</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;}</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* DOLL_H_ */</span><span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Apr 12 2014 10:53:26 for Clique Projection by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
